#include<bits/stdc++.h>
#define int long long
#define ls(x) ((x)*2)
#define rs(x) ((x)*2+1)
#define Debug(...) fprintf(stderr, __VA_ARGS__)
#define For(i,a,b) for(int i=a,i##end=b;i<=i##end;i++)
#define Rof(i,a,b) for(int i=a,i##end=b;i>=i##end;i--)
#define rep(i,  b) for(int i=1,i##end=b;i<=i##end;i++)
using namespace std;
const int N=1e6+5,base=999983,Mod=998244353;
//char buf[(1<<21)+5],*p1,*p2;
//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
inline void chmx(int &x,int y){(x<y)&&(x=y);}
inline void chmn(int &x,int y){(x>y)&&(x=y);}
inline void Add(int &x,int y){(x=x+y+Mod)%=Mod;}
inline int read(){
	int f=0,x=0;
	char ch=getchar();
	while(!isdigit(ch)){f|=(ch=='-');ch=getchar();}
	while(isdigit(ch)){x=(x<<3)+(x<<1)+(ch^48);ch=getchar();}
	return f?-x:x;
}
void print(int n){
    if(n<0){
        putchar('-');
        n*=-1;
    }
    if(n>9) print(n/10);
    putchar(n%10+'0');
}
int n,x; 
struct XXX{
	int a,h;
}z[N];
inline bool cmp(XXX x,XXX y){
	if(x.a==y.a) return x.h>y.h;
	return x.a<y.a;
}
int dp[N];
int qzh[N];
int sta[N],tot;
int a[N];
//inline int query(int l,int r){
//	if(l==0) return 1e16;
//	if(l>r) return 1e16;
//	int k=lg[r-l+1];
//	return min(st[l][k],st[r-(1<<k)+1][k]);
//}
bool vis[N];
signed main(){
	freopen("xinyue.in","r",stdin);
	freopen("xinyue.out","w",stdout);
	// ios::sync_with_stdio(false);
	// cin.tie(0); cout.tie(0);
//	lg[0]=-1;
//	For(i,1,N-5) lg[i]=lg[i/2]+1;
	n=read();z[0].a=read();
	For(i,1,n) {
		z[i].a=read();z[i].h=read();
	}sort(z+1,z+n+1,cmp);
	memset(dp,0x3f,sizeof(dp));
	dp[0]=0;
	For(j,1,n)qzh[j]+=qzh[j-1]+(z[j].h-1)/z[n].a*z[j].a;
	For(i,1,n){
		dp[i]=qzh[i-1]+(z[i].h-1)/z[0].a*z[i].a;
	}For(i,1,n) a[i]=z[i].a;
//	memset(st,0x3f,sizeof(st));
//	For(i,1,n){
//		int l=1,r=0;int M=z[i].h-1;
//		For(j,1,n) vis[j]=0;
//		int lst=0;
//		for(;l<=M;l=r+1){
//			r=M/(M/l);
//			int L=lst+1,R=lst;
//			lst=R;
//			dp[i]=min(dp[i],query(min(L,i+1),min(R,i))+qzh[i-1]+(M/l)*z[i].a);
//		}int k=upper_bound(a+1,a+n+1,z[i].h-1)-a;
//		dp[i]=min(dp[i],query(k,i-1)+qzh[i-1]);
//		
//		st[i][0]=dp[i]-qzh[i];
//		For(j,1,20){
//			if(i-(1<<j)+1>=1)st[i-(1<<j)+1][j]=min(st[i-(1<<(j-1))+1][j-1],st[i-(1<<j)+1][j-1]);
//			else break;
//		}
//	}printf("%lld\n",dp[n]);
//	
	memset(dp,0x3f,sizeof(dp));
	dp[0]=0;
	int B=100000000/n;
	For(i,1,n){
		int val=0;
		if(i&&z[i].a<=z[0].a) continue;
		Rof(t,tot,max(0ll,tot-B)){
			int j=sta[t];
			dp[i]=min(dp[j]+qzh[i-1]-qzh[j]+(z[i].h-1)/z[j].a*z[i].a,dp[i]);
		}
		while(tot&&z[i].a>=z[sta[tot]].a&&dp[i]<=dp[sta[tot]])tot--;
		sta[++tot]=i;
	}
	printf("%lld\n",dp[n]);
#ifdef LOCAL
    Debug("\nMy Time: %.3lfms\n", (double)clock() / CLOCKS_PER_SEC);
#endif
	return 0;
}

